var oBackTop = document.querySelector(".back-top");

oBackTop.onclick = () => {
    oBackTop.timer = setInterval(function() {
        let current = Utils.getScroll().top; //当前值
        // console.log(current);
        let target = 0; // 目标值
        let steps = (target - current) / 10; // 步长
        steps = steps > 0 ? Math.ceil(steps) : Math.floor(steps);
        window.scroll(0, current + steps);
        if (current == target) {
            clearInterval(oBackTop.timer);
        }
    }, 20)


}
window.onscroll = function() {
    let noHeight = Utils.getScroll().top;

    oBackTop.style.display = noHeight > 0 ? 'block' : "none";
}